from .control import Control


class ContextMenu(Control):
    '''
    右键菜单操作
    '''

    def get_menu_items_text(self):
        '''
        获取菜单下所有的文本信息

        :Returns:
            返回所有菜单的集合
        '''
        return self.control.GetMenuItemsText

    def select_item_by_index(self, id):
        '''
        通过索引选择菜单

        :Args:
         - id: 菜单索引
        '''
        self.control.SelectItemByIndex(id)

    def select_item_by_text(self, txt):
        '''
        通过文字选择菜单

        :Args:
         - txt: 菜单的文字
        '''
        self.control.SelectItemByText(txt)
